扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
第一种,只是使用到了GRE,没有使用GRE封装,只是感兴趣刘通过GRE隧道,用IPSEC加密
R1
crypto isakmp policy 10
authentication pre-share
crypto isakmp key cisco address 12.12.12.2
crypto ipsec transform-set myset esp-des esp-md5-hmac
mode transport
crypto map mymap 10 ipsec-isakmp
set peer 12.12.12.2
set transform-set myset
match address 101
interface Loopback0
ip address 10.1.1.1 255.255.255.0
interface Tunnel0
ip address 21.21.21.1 255.255.255.0
tunnel source FastEthernet0/0
tunnel destination 12.12.12.2
interface FastEthernet0/0
ip address 12.12.12.1 255.255.255.0
crypto map mymap
router ospf 1
log-adjacency-changes
network 10.1.1.1 0.0.0.0 area 0
network 21.21.21.1 0.0.0.0 area 0
access-list 101 permit ip host 12.12.12.1 host 12.12.12.2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
第二种:真正的GRE over IPSEC先封装GRE再用IPSEC加密
R2
crypto isakmp policy 10
authentication pre-share
crypto isakmp key cisco address 12.12.12.1
crypto ipsec transform-set myset esp-des esp-md5-hmac
mode transport
crypto ipsec profile mysecfile
set transform-set myset
interface Loopback0
ip address 20.1.1.1 255.255.255.0
interface Tunnel0
ip address 21.21.21.2 255.255.255.0
tunnel source FastEthernet0/0
tunnel destination 12.12.12.1
tunnel protection ipsec profile mysecfile
interface FastEthernet0/0
ip address 12.12.12.2 255.255.255.0
router ospf 1
log-adjacency-changes
network 20.1.1.1 0.0.0.0 area 0
network 21.21.21.2 0.0.0.0 area 0
验证:show crypto engine connections active
濠电姷顣介埀顒€鍟块埀顒€缍婇幃妯诲緞閹邦剛鐣洪梺闈浥堥弲婊勬叏濠婂牊鍋ㄦい鏍ㄧ〒閹藉啴鏌熼悜鈺傛珚鐎规洘宀稿畷鍫曞煛閸屾粍娈搁梻浣筋嚃閸ㄤ即宕㈤弽顐ュС闁挎稑瀚崰鍡樸亜閵堝懎濮┑鈽嗗亝濠㈡ê螞濡ゅ懏鍋傛繛鍡樻尭鐎氬鏌嶈閸撶喎顕i渚婄矗濞撴埃鍋撻柣娑欐崌閺屾稑鈹戦崨顕呮▊缂備焦顨呴惌鍌炵嵁鎼淬劌鐒垫い鎺戝鐎氬銇勯弽銊ф噥缂佽妫濋弻鐔碱敇瑜嶉悘鑼磼鏉堛劎绠為柡灞芥喘閺佹劙宕熼鐘虫緰闂佽崵濮抽梽宥夊垂閽樺)锝夊礋椤栨稑娈滈梺纭呮硾椤洟鍩€椤掆偓閿曪妇妲愰弮鍫濈闁绘劕寮Δ鍛厸闁割偒鍋勯悘锕傛煕鐎n偆澧紒鍌涘笧閹瑰嫰鎼圭憴鍕靛晥闂備礁鎼€氱兘宕归柆宥呯;鐎广儱顦伴崕宥夋煕閺囥劌澧ù鐘趁湁闁挎繂妫楅埢鏇㈡煃瑜滈崜姘跺蓟閵娧勵偨闁绘劕顕埢鏇㈡倵閿濆倹娅囨い蹇涗憾閺屾洟宕遍鐔奉伓